<?php $this->Html->addCrumb('My Message','/messages'); ?>
<?php $this->Html->addCrumb('Group Message'); ?>
<div id="left" style="float:left;">

    <!-- begin all content here -->
    <!-- success --><!-- error -->
    <?php
    echo $this->Session->flash();
    if ($this->Session->check('Message.auth'))
        echo $this->Session->flash('auth');
    ?>
    <div class="global-title"><?php __('Group Message'); ?></div>
    <div class="div_content">
        <div class="paging" style="padding-bottom:15px;">
            <?php echo $this->element('message/top_menu'); ?>
	</div>
         <div>

        <form method="post" id="suspendfrm" action="<?php echo Configure::read('base_url')."messages/group_message"; ?>" enctype="multipart/form-data">
    <table cellspacing="0" width="100%">
        <tbody>
            <tr>
                <td width="70" align="left">
                   <b> From:</b>
                </td>
                <td width="247">
                    <font size="4px;">
                    <?php
                    echo $session->read('Auth.User.username');
                    ?>
                    </font>
                </td>
            </tr>
            <tr>
                <td width="25" align="left">
                   To:
                </td>
                <td width="247">
             <?php
		$options=array('All'=>'All','Q-Admins'=>'Q-Admins','Sellers'=>'Sellers','Buyers'=>'Buyers');
		echo $this->Form->select('to_group',$options,null,array('empty'=>'Select Recipient','class'=>'required'));
		?>
          <?php
        //echo $this->Form->input('to_id',array('label'=>false,'div'=>false,'class'=>'small anyOnerequired','value'=>'Enter ID','onfocus'=>"if(this.value=='Enter ID'){this.value=''}", 'onblur'=>"if(this.value==''){this.value='Enter ID'}"));
         ?>
                </td>
            </tr>
           <tr>
                <td width="25" align="left">
                   Subject:
                </td>
                <td width="247">
                    <?php
        echo $this->Form->input('Message.subject',array('label'=>false,'div'=>false,'type'=>'text','class'=>'required', 'size'=>"70px"));
        ?>
                </td>
            </tr>
            <tr>
                <td width="25" align="left">
            Accept replies?:
                </td>
                <td width="247">
                    <?php
		$options=array('1'=>'No','0'=>'Yes');
		echo $this->Form->select('reply',$options,null,array('empty'=>false,'class'=>'required'));
		?>
                </td>
            </tr>
            <tr>
                <td width="25" align="left">
                   Item #:
                </td>
                <td width="247">
               <?php
        echo $this->Form->input('Message.item',array('label'=>false,'div'=>false,'class'=>'small'));
        ?>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="left" style="background:#ccc;font-size: 15px;">
                Message Content
                </td>
            </tr>
            <tr>
                <td colspan="2" align="left">
                    <?php echo $form->textarea('Message.message', array('cols' => '85', 'rows' => '15','class'=>'fckrequired'));?>
		<?php echo $fck->load('Message.message', 'Custom');?>
                <?php
                //echo $this->Form->input('message',array('label'=>false,'div'=>false,'type'=>'textarea','class'=>'required', 'size'=>"70px",'rows'=>15,'cols'=>85));
                ?>
                    <?php //echo $fck->load('message', 'Custom');?>
                </td>
            </tr>
        <tr>
                <td colspan="2" align="left">
                 <input type="submit" style="background:#73AE0B; color:#fff; font-size:14px;" name="button" id="button" value="Submit" />
                 &nbsp;&nbsp;<input type="reset" style="background:#73AE0B; color:#fff; font-size:14px;" name="cancel"  value="Cancel" />
                </td>
            </tr>
        </tbody>
    </table>
        </form>
       </div>
        </div>
            
        </div>

        <!-- edit sidebar items here -->

    <?php
    echo $this->Html->css('table_css');
    ?>
<?php echo $html->script(array("jquery.pagination.js", "jquery.tablesorter.min.js", "jquery.tablednd.js","jquery.validate.js")); ?>
<script type="text/javascript">
    jQuery(document).ready(function(){

    jQuery.validator.addMethod("fckrequired", function (value, element) {
        var oEditor = FCKeditorAPI.GetInstance('MessageMessage') ;
        var pageValue = oEditor.GetHTML(true);
        pageValue=jQuery.trim(pageValue);
        if ( pageValue == "<br />" || pageValue == "") {
            return false;
        }else{
            return true;
        }
    }, "This field is required.");


        jQuery("#category_table").tablesorter({headers: {0:{sorter: false}, 1:{sorter: false}, 6:{sorter: false}}});
 var v = jQuery("#suspendfrm").validate({

                       });

});
</script>